package org.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.example.entity.SysMenu;

import java.util.List;

/**
select sm.id, sm.title, sm.parent_id, sm.url, sm.name, sm.perms, sm.type, sm.icon, sm.hidden
	FROM sys_user su
		JOIN sys_user_role sur ON su.id = sur.user_id
		JOIN sys_role sr ON sur.role_id = sr.id
		JOIN sys_role_menu srm ON srm.role_id = sr.id
	  JOIN sys_menu sm ON srm.menu_id = sm.id
		WHERE su.name = 'lux'
 */
@Mapper
public interface SysMenuMapper extends BaseMapper<SysMenu> {

    List<SysMenu> getSysMenuByUsername(String name);

    List<String> getPerms(String name);

	List<SysMenu> getMenuList();

	List<SysMenu> getRoleMenu(Integer id);
}
